package com.lin.mptest.controller;

import com.lin.mptest.service.db1.ITestAService;
import com.lin.mptest.service.db2.ITestBService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@Slf4j
@RequestMapping("/test")
public class HelpController {

    @Autowired
    private ITestAService iTestAService;

    @Autowired
    private ITestBService iTestBService;

    /**
     * https://mp.baomidou.com/guide/dynamic-datasource.html
     */
    @GetMapping("/test")
    public void test() {
        log.info("==========数据库A数据");
        log.info(iTestAService.getAll().toString());
        log.info("==========数据库B数据");
        log.info(iTestBService.getAll().toString());
    }

}

